package com.siki.vo;

import com.siki.entity.bigdata.Chess;
import io.swagger.annotations.ApiModelProperty;


import io.swagger.annotations.ApiModel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.Optional;

/**
 * @author Siki
 * @date 2020/12/22
 */

@ApiModel("返回数据VO")
@Getter
@Setter
@NoArgsConstructor
public class ChessVO {
    @ApiModelProperty("数据id")
    private Integer id;

    @ApiModelProperty("走棋参数")
    private String init;

    @ApiModelProperty("根据init参数应对的走棋参数")
    private String moveInit;

    @ApiModelProperty("出现次数")
    private String count;

    public ChessVO(Chess chess_) {
        Optional.ofNullable(chess_).ifPresent(chess -> {
            this.id = chess.getId();
            this.init = chess.getInit();
            this.moveInit = chess.getMoveInit();
            this.count = chess.getCount();
        });

    }
}
